<?php

namespace addons\podunk\validate;

use think\Validate;

class Agent extends Base
{

    /**
     * 验证规则
     */
    protected $rule = [
        'id'   => 'require|isPositiveInteger',
        'nickname'=> 'require',
        'port' => 'require|isPositiveInteger',
    ];

    /**
     * 提示消息
     */
    protected $message = [
        'id.require' => '未知错误',
        'nickname.require' => '未知错误',
        'port.require' => '端口数必须填写',
        'id.isPositiveInteger'=>'未知字符',
        'port.isPositiveInteger'=>'端口请填写正整数'
    ];

    /**
     * 字段描述
     */
    protected $field = [

    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'rechargePort' => ['id','nickname','port'],
        'reducePort' => ['id','nickname','port'],
    ];

}
